package com.bsdsma.visonManagementSystemapp.utils;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class PriceUtils {

    /**
     * 价格转换 分转元
     */
    public static String parsePriceYuan(Long price) {
        if (null == price || price.equals(0L)) {
            return "0";
        }
        return new BigDecimal(price + "")
                .divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP)
                .stripTrailingZeros().toPlainString();
    }
}
